package com.microservice.wechat.service.impl;

import com.microservice.wechat.entity.ArticleReviewRecord;
import com.microservice.wechat.mapper.ArticleReviewRecordMapper;
import com.microservice.wechat.service.ArticleReviewRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 文章审核记录服务实现类
 */
@Service
public class ArticleReviewRecordServiceImpl implements ArticleReviewRecordService {

    @Autowired
    private ArticleReviewRecordMapper articleReviewRecordMapper;

    @Override
    public boolean save(ArticleReviewRecord record) {
        return articleReviewRecordMapper.insert(record) > 0;
    }

    @Override
    public List<ArticleReviewRecord> getByArticleId(Long articleId) {
        return articleReviewRecordMapper.selectByArticleId(articleId);
    }

    @Override
    public ArticleReviewRecord getLatestByArticleId(Long articleId) {
        return articleReviewRecordMapper.selectLatestByArticleId(articleId);
    }
}
